﻿@namespace BootstrapBlazor.Components
@inherits BootstrapComponentBase

<a @attributes="@AdditionalAttributes" class="@ClassString">
    @if (!string.IsNullOrEmpty(Item?.Icon))
    {
        <i class="@Item.Icon"></i>
    }
    <span>@Item?.Text</span>
    <i class="fa fa-angle-down nav-link-right"></i>
    <ul class="nav sub-menu">
        @foreach (var item in (Item?.Items ?? new MenuItem[0]))
        {
            <li class="@GetClassString("nav-item", item)">
                @if (item.Items.Any() && !item.IsDisabled)
                {
                    <SubMenu Item="@item" class="nav-link" OnClick="@OnClick" />
                }
                else
                {
                    <MenuLink Item="@item" class="nav-link" OnClick="@OnClick" />
                }
            </li>
        }
    </ul>
</a>